#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:6031)

#include <stdio.h>
#include <assert.h>

char* my_strcat(char* destination, const char* source)
{
	char* ret = destination;
	assert(destination != NULL);
	assert(source != NULL);

	while (*destination != '\0')
	{
		destination++;
	}
	while (*source != '\0')
	{
		*destination = *source;
		destination++;
		source++;
	}
	*destination = '\0';

	return ret;
}

char* peng_strcat(char* destination, const char* source)
{
	char* ret = destination;
	assert(destination != NULL);
	assert(source != NULL);

	while (*destination != '\0')
	{
		destination++;
	}
	while (*destination++ = *source++)
	{
		;
	}
	
	return ret;
}

int main()
{
	char str1[100] = "zhao";
	char str2[20] = "zhaojianguo";

	char* pstr1 = my_strcat(str1, str2);
	printf("%s\n", pstr1);

	char* pstr2 = peng_strcat(str1, str2);


	printf("%s\n", pstr2);


	return 0;
}